﻿using System.Collections.Generic;
using System.Web.Mvc;
using WebApplication1.Models;

namespace WebApplication1.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            Main mainCls = new Main();

            User user = new User
            {
                Id = 1,
                Name = "Ivan Zlatev",
                FavouriteMovies = new List<Movie>
                {
                    new Movie {Title = "Movie 1", Rating = 5},
                    new Movie {Title = "Movie 2", Rating = 10},
                    new Movie {Title = "Movie 3", Rating = 12}
                }
            };

            mainCls.UserList = user;

            return View(mainCls);

        }

        [HttpPost]
        public ActionResult Index(Main mainCls)
        {
            return View(mainCls);

        }
    }
}